package com.tanhua.manage;

import com.tanhua.manager.service.AnalysisByDayService;
import org.joda.time.DateTime;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;

@Component
public class AnalysisJob {

    @Autowired
    private AnalysisByDayService analysisService;

    @Scheduled(cron = "0/10 * * * * ?")  //每10秒
//    @Scheduled(cron = "0 0 * * * ?")  TODO
    public void analysis(){

        String todayStr = new DateTime().toString("yyyy-MM-dd");
        analysisService.analysis(todayStr);
    }


}
